This repository was archived by the owner on Nov 15, 2023. It is now read-only.
grandpa: always store justification for the latest finalized block#8392
Merged
6 commits merged intomasterfrom Apr 1, 2021
Merged
grandpa: always store justification for the latest finalized block#83926 commits merged intomasterfrom
6 commits merged intomasterfrom
Conversation
Contributor
Author
|
Still want to add some tests for this. |
Contributor
|
Awesome, nicely done! |
andresilva
commented
Mar 18, 2021
Contributor
Author
|
Sorry but I forgot about this PR. Should be good to merge now. |
Contributor
|
I'm not qualified to review, but I enjoy the idea of merging this. |
Contributor
Author
Contributor
Author
|
bot merge |
|
Trying merge. |
hirschenberger
pushed a commit
to hirschenberger/substrate
that referenced
this pull request
Apr 14, 2021
…aritytech#8392) * grandpa: always store justification for best finalized block * grandpa-warp-sync: add latest justification when finished proving * grandpa-warp-sync: change logic for sending best justification when finished * grandpa: test storing best justification * grandpa: reorder variants in WarpSyncFinished
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently when GRANDPA finalizes a block the client does not always persist the justification. It currently only does it: on authority set change blocks, randomly every N blocks. Since the only justifications that are required to provably sync the chain correctly are for the authority set handoffs it would just contribute to database bloat if we kept justifications for everything that's finalized. Still having a justification at hand for a recent block is useful to prove finality to light clients who don't participate in the GRANDPA protocol.
This PR adds a GRANDPA auxiliary storage entry where we always store the justification for the latest finalized block and overwrite it once a new block gets finalized.
Additionally I updated the warp sync protocol to make sure that we send the latest justification once we have finished warp syncing to the latest authority set.